package com.example.demo;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class ExceptionHandle{
		/**
		 * 异常拦截
		 * */
	  @ExceptionHandler(value = Exception.class)
      @ResponseBody
      public String exceptionGet(Exception ex){
			return "出错啦";
		
      }
  }  
  